<template>
  <div id="app">
    <h1>vue components</h1>
    <search-area background-color="orange" title="百度一下"></search-area>
    <search-area background-color="#f40" title="淘宝一下">
      <template v-slot:before>
        <div class="red">淘宝搜索：</div>
      </template>
    </search-area>
    <search-area title="google"></search-area>
    <search-area :list="[1, 2, 'a']">

      <template v-slot:before>
        <div class="red">{{msg}}</div>
      </template>
      <template v-slot:after>
        <button>{{after}}</button>
      </template>
<!--      <img src="">-->

<!--
slot
插槽相当于父组件向子组件 传 html
-->
    </search-area>
  </div>
</template>

<script>

import SearchArea from './components/SearchArea'

export default {
  name: 'App',
  components: {
    SearchArea
  },
  data() {
    return {
      msg: '搜索：',
      after: '搜索：'
    }
  },
}
</script>

<style>
  * {
    margin: 0;
    padding: 0;
  }
  #app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #2c3e50;
  }

  .red {
    color: #fff;
    background-color: red;
  }

  .blue {
    background-color: blue;
  }
</style>


<!--
index.html
show.html

index
show
about

/
/show

/todos.html
/totos-show.html?id=34567890

/todos
/todos/1234567


-->

